<header class="page-header clearfix">
    <h4><i class="fa fa-gears"></i>应用管理</h4>

    <div class="toolbox">
        <a ui-sref="app-service-publish.base"><i class="fa fa-plus"></i>创建应用</a>
    </div>
    <ol class="breadcrumb">
        <li><a>我的应用</a></li>
        <li class="active">应用管理</li>
    </ol>
</header>
<section>
    <ui-panel class="panel-list">
        <form class="form-inline form-search" ng-submit="list.search()">
            <div class="form-group">
                <input type="text" maxlength="50" ng-model="list.filter.name" class="form-control" placeholder="请输入应用名称查询"/>
            </div>
            <button class="btn btn-default" type="submit">查询</button>
        </form>
        <table class="table table-hover">
            <thead>
            <tr>
                <th width="20%">编码</th>
                <th width="20%">名称</th>
                <th width="25%">所在集群</th>
                <th width="15%">所在租户</th>
                <th width="20%">创建时间</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="elem in list.table">
                <td class="row-head" ng-switch="elem.deleting">
                    <a ui-sref="app-service-detail({id: elem.appId})">{{::elem.appCode}}</a>
                    <div class="toolbox" ng-switch-default>
                        <a ng-click="list.deleteApp(elem)"  title="删除"><i class="fa fa-times fa-lg"></i></a>
                    </div>
                    <div class="toolbox tb-loading" ng-switch-when="true"><div class="loading-sm"/></div>
                </td>
                <td>{{::elem.appName}}</td>
                <td><a style="font-size: 12px; font-weight: bold" ui-sref="k8s-overview({kDbCode: elem.k8sCode})">
                    {{::elem.k8sCode}}</a></td>
                <td><a style="font-size: 12px; font-weight: bold" ui-sref="k8s-lessee({kDbCode: elem.k8sCode})">
                    {{::elem.namespace}}</a></td>
                <td>{{::elem.createTime | date: 'yyyy-MM-d HH:mm:ss'}}</td>
            </tr>
            </tbody>
        </table>
        <!--Loading-->
        <div class="loading" ng-show="!list.table"></div>
        <!--分页-->
        <div ng-show="list.table" class="pagination-group">
            <ui-pagination-info items-per-page="10" items-per-page-select="false"
                                total-items="list.page.totalItems"
                                current-page="list.page.currentPage"></ui-pagination-info>
            <button type="button" ng-click="list.getList()" class="btn btn-default btn-refresh"><i
                    class="fa fa-refresh"></i></button>
            <ui-pagination items-per-page="10" total-items="list.page.totalItems"
                           ng-model="list.page.currentPage" ng-change="list.getList()"></ui-pagination>
        </div>
    </ui-panel>
</section>